/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ac.persistence;

import ac.entities.Animal;
import com.ibatis.sqlmap.client.SqlMapClient;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;



/**
 * Gestiona la persistencia de animales
 * @author prometheus
 */
public class PersistAnimal {

    /**
     * Busca todos los registros de animales
     * @return todos los animales.
     */
    public ArrayList<Animal> buscarTodosAnimales() {
        ArrayList<Animal> result = null;
        try {
            SqlMapClient sqlMap = SqlConnector.getInstance().getReady();
            result = (ArrayList) sqlMap.queryForList("buscarTodosAnimales");
        } catch (IOException ioe) {
            ioe.printStackTrace();
        } catch (SQLException sqle) {
            sqle.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            return result;
        }
    }

    
}
